package com.axxc.cloud.service.slave.impl;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.axxc.cloud.common.util.StringFormatUtil;
import com.axxc.cloud.mapper.slave.SlaveUserMapper;
import com.axxc.cloud.service.slave.ISlaveUserService;

@Service
public class SlaveUserServiceImpl implements ISlaveUserService {
	@Autowired
	private SlaveUserMapper slaveUserMapper;

	@Override
	public List<String> listAllUserMaster() {
		return slaveUserMapper.listAllUserSlave();
	}

	@Override
	@Transactional(transactionManager = "slavePlatformTransactionManager")
	public void insert(String name) {
		slaveUserMapper.insert(StringFormatUtil.format("{0}---{1}", name, LocalDateTime.now()));
	}

}
